﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RestSharp;
using Ymatou.API.Common;
using Ymatou.ServiceCenter;
using YmatouSeller.NoticeAPI.Model.Enums;
using YmatouSeller.NoticeAPI.Model.Response;

namespace YmatouSeller.NoticeAPI.Model.Request
{
   [Resource("sellernotice.iapi.ymatou.com", "api/QueryNotice/GetSystemNoticeDetailList", Method.GET, ParameterBuildType.Json)]
   public class GetSystemNoticeDetailListRequest : BaseRequestModel<GetSystemNoticeDetailListResponse>
    {

        public override string ApiName
        {
            get { return "api/QueryNotice/GetSystemNoticeDetailList"; }
        }

        public override bool HttpGet
        {
            get { return true; }
        }

        public int SellerId { get; set; }


        /// <summary>
        /// 通知类型
        /// </summary>
        public NoticeTypeEnum NoticeType { get; set; }

        public DateTime? BeginTime { get; set; }

        public DateTime? EndTime { get; set; }

        public int PageIndex { get; set; }

        public int PageSize { get; set; }

        public override void Validate()
        {
            const string errCode = "-1";
            if (SellerId == 0)
                throw new Ymatou.API.Common.BussniessException(errCode, "买手id不能为0");
            if (PageIndex <= 0) PageIndex = 1;
            if (PageSize <= 0) PageSize = 20;
            base.Validate();
        }
    }
}
